local jiumeng_jiewangquan = fk.CreateSkill {

  name = "jiumeng_jiewangquan",

  tags = {  },

}



jiumeng_jiewangquan:addEffect("active", {
  name = "jiumeng_jiewangquan",
  anim_type = "offensive",
  prompt = "#jiumeng_jiewangquan_evoke",
  can_use = function (self, player)
    return player:getHandcardNum() > 0
  end,
  card_num = 1,
  card_filter = function (self, player, to_select, selected)
    return #selected == 0
  end,
  target_num = 1,
  target_filter = function (self, player, to_select, selected, selected_cards)
    return #selected == 0 and to_select ~= player
  end,
  on_use = function (self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    room:throwCard(effect.cards,jiumeng_jiewangquan.name,player,player)
    room:damage{
      to = target,
      damage = 1,
      damageType = fk.FireDamage,
      skillName = jiumeng_jiewangquan.name,
      from = player,
    }
    local to = room:askToChoosePlayers(player,{ targets = room.alive_players, min_num = 1, max_num = 1, prompt = "jiumeng_jiewangquan_chain", skill_name = jiumeng_jiewangquan.name, cancelable = true, no_indicate = false})
    if #to > 0 then
      to[1]:setChainState(true)
    end
  end,
})

return jiumeng_jiewangquan